import Button from "../../components/Button"

interface PostIdProps {
    content: string
}

function PostId({content}: PostIdProps) {
    return <>
        <div>{content}</div>
        <Button />
    </>

}

export async function getStaticPaths() {
    const posts = ['1','2','3']
    const paths = posts.map(id => ({
        params: {
            id
        }
    }))
    return {paths, fallback: false}
}

interface Iprops {
    params: {
        id: number
    }
}

export async function getStaticProps({params}: Iprops) {
    const content = `this is article ${params.id}`
    return {
        props: {
            content
        }
    }
}
    
export default PostId